package com.hongdu.batch.quartz.job;

import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * <h3>partitionjob</h3>
 * <p>myjob</p>
 * https://www.cnblogs.com/eelve/p/11333897.html
 * @author : hduong
 * @version : 1.0
 * @date : 2020-04-03 14:18
 **/
@Slf4j
public class MyJob extends QuartzJobBean {

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        // 获取参数
        JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
        // 业务逻辑 ...
        log.info("------springbootquartzonejob执行" +
                jobDataMap.get("name").toString()+"###############"+context.getTrigger());
    }
}
